package com.qf.service.impl;

import com.qf.base.QFDataSource;
import com.qf.demo.enums.DataSourceType;
import com.qf.demo.order.Order;
import com.qf.mapper.db1.OrderMapper;
import com.qf.mapper.db2.UserMapper;
import com.qf.service.IOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@QFDataSource(DataSourceType.secondaryDataSource)
@Service
public class IOrderServiceImpl implements IOrderService {
    @Autowired
    private UserMapper userMapper;

    @Autowired
    private OrderMapper orderMapper;


    @QFDataSource(DataSourceType.secondaryDataSource)
    @Override
    public Object createOrder() {
        Order order = new Order();
        order.setOrderNumber("515151561");
        order.setAmount(123.23);
        orderMapper.insert(order);
        return order;
    }

}
